package com.weipai.demo.controller;

import com.weipai.demo.model.CarBrand;
import com.weipai.demo.model.CarParameter;
import com.weipai.demo.model.VehicleModel;
import com.weipai.demo.service.CarPriceService;
import com.weipai.demo.util.LayuiTablePagingResult;
import com.weipai.demo.util.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 赵项阳
 * @Date: 2019/6/25 14:59
 * @Version 1.0
 */
@RestController
public class CarPriceController {

    @Autowired
    private CarPriceService carPriceService;

    //车贷信息的添加或修改
    @RequestMapping(value = "/car/save")
    public Response save(CarBrand carBrand, CarParameter carParameter, VehicleModel vehicleModel){
        return carPriceService.save(carBrand,carParameter,vehicleModel);
    }

    //==================================================================================================================

    //前端页面车贷信息显示
    @RequestMapping(value = "/car/frontShow")
    public Response frontShow( String display){
        return carPriceService.frontShow(display);
    }

    @RequestMapping(value = "car/frontVehicle")
    public Response frontVehicle(String bId){

        return carPriceService.frontVehicle(bId);
    }

    //==================================================================================================================


    //后台显示车贷信息
    @RequestMapping(value = "/car/pageShow")
    public LayuiTablePagingResult pageShow(Integer page, Integer size, String display){
        return carPriceService.pageShow(page,size,display);
    }


}
